import service from '@/utils/request'

// @Tags FirstOrderProcessing
// @Summary 创建首办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.FirstOrderProcessing true "创建首办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /firstOrderProcessing/createFirstOrderProcessing [post]
export const createFirstOrderProcessing = (data) => {
  return service({
    url: '/firstOrderProcessing/createFirstOrderProcessing',
    method: 'post',
    data
  })
}

// @Tags FirstOrderProcessing
// @Summary 删除首办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.FirstOrderProcessing true "删除首办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /firstOrderProcessing/deleteFirstOrderProcessing [delete]
export const deleteFirstOrderProcessing = (params) => {
  return service({
    url: '/firstOrderProcessing/deleteFirstOrderProcessing',
    method: 'delete',
    params
  })
}

// @Tags FirstOrderProcessing
// @Summary 批量删除首办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除首办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /firstOrderProcessing/deleteFirstOrderProcessing [delete]
export const deleteFirstOrderProcessingByIds = (params) => {
  return service({
    url: '/firstOrderProcessing/deleteFirstOrderProcessingByIds',
    method: 'delete',
    params
  })
}

// @Tags FirstOrderProcessing
// @Summary 更新首办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.FirstOrderProcessing true "更新首办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /firstOrderProcessing/updateFirstOrderProcessing [put]
export const updateFirstOrderProcessing = (data) => {
  return service({
    url: '/firstOrderProcessing/updateFirstOrderProcessing',
    method: 'put',
    data
  })
}

// @Tags FirstOrderProcessing
// @Summary 用id查询首办单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.FirstOrderProcessing true "用id查询首办单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /firstOrderProcessing/findFirstOrderProcessing [get]
export const findFirstOrderProcessing = (params) => {
  const { version } = params;
  return service({
    url: version ? '/firstOrderProcessing/getFirstOrderProcessingHistory': `/firstOrderProcessing/findFirstOrderProcessing`,
    method: 'get',
    params
  })
}

// @Tags FirstOrderProcessing
// @Summary 分页获取首办单列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取首办单列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /firstOrderProcessing/getFirstOrderProcessingList [get]
export const getFirstOrderProcessingList = (params) => {
  return service({
    url: '/firstOrderProcessing/getFirstOrderProcessingList',
    method: 'get',
    params
  })
}

export const updateFirstOrderProcessingStatus = (data) => {
  return service({
    url: '/firstOrderProcessing/updateFirstOrderProcessingStatus',
    method: 'put',
    data
  })
}



export const firstOrderProcessingPrint = (params) => {
  return service({
    url: '/firstOrderProcessing/print',
    method: 'get',
    params
  })
}

export const firstOrderMoldHouseList = (params) => {
  return service({
    url: '/firstOrderProcessingMoldHouse/getFirstOrderProcessingMoldHouseList',
    method: 'get',
    params
  })
}

export const createFirstOrderMoldHouse = (data) => {
  return service({
    url: '/firstOrderProcessingMoldHouse/createFirstOrderProcessingMoldHouse',
    method: 'post',
    data
  })
}

export const updateFirstOrderMoldHouse = (data) => {
  return service({
    url: '/firstOrderProcessingMoldHouse/updateFirstOrderProcessingMoldHouse',
    method: 'put',
    data
  })
}

// 查与上版本配件对比数据
export const versionComparison = (params) => {
  return service({
    url: '/firstOrderProcessing/versionComparison',
    method: 'get',
    params
  })
}

// 客户确认时间
export const customerConfirmFirstOrderTime = (data) => {
  return service({
    url: '/firstOrderProcessing/verifyFirstOrderProcessing',
    method: 'put',
    data
  })
}

// 批量完成
export const batchComplete = (data) => {
  return service({
    url: '/largeScaleOrder/batchComplete',
    method: 'post',
    data
  })
}

// 批量完成
export const updateProductionDepartment = (data) => {
  return service({
    url: 'firstOrderProcessing/updateProductionDepartment',
    method: 'post',
    data
  })
}

/**
 * 获取历史版本
 * @param {*} params 
 * @returns 
 */
export const getFirstOrderProcessingHistoryList = (params) => {
  return service({
    url: '/firstOrderProcessing/getFirstOrderProcessingHistoryList',
    method: 'get',
    params
  })
}
/**
 * 导出配料清单
 * @param {*} params 
 * @returns 
 */
export const firstOrderProcessingExport = (params) => {
  return service({
    url: '/firstOrderProcessing/export',
    method: 'get',
    params
  })
}
/**
 * 汇入SAP
 * @param {*} params 
 * @returns 
 */
export const createInSapByHand = (params) => {
  return service({
    url: '/firstOrderProcessing/createInSapByHand',
    method: 'get',
    params
  })
}

